/*
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or (at
 * your option) any later version.
 *
 * This program is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
 * 02110-1301, USA.
 * */

// AmzServer - Tototoy's server model.
// Author: tonyjobmails@gmail.com (tonyhack).
//
// Define class TCPSocketCommunicator.
//
// TCPSocketCommunicator uses to send/receive TCP stream data.
//

#ifndef __TCP__SOCKET__COMMUNICATOR__H
#define __TCP__SOCKET__COMMUNICATOR__H

#include "tcp_socket.h"
#include "message_packet.h"

namespace amz {

class TCPSocketCommunicator : public TCPSocket {
 public:
  TCPSocketCommunicator(int socket, CompressType compress, EncryptType encrypt)
         : TCPSocket(socket), packet_(compress, encrypt) {}
  virtual ~TCPSocketCommunicator() {}

  // Use for TCP buffer socket.
  virtual int Send() { return 0; }
  virtual int Receive() { return 0; }
  virtual void LoopReceive() {}

 protected:
  MessagePacket packet_;
};

}  // namespace amz

#endif  // __TCP__SOCKET__COMMUNICATOR__H
